#include "Transform2D.h"
#include "support.h"

Transform2D::Transform2D(const cv::Mat &transformationMatrix) : Filter(1, 1), transformationMatrix(transformationMatrix)
{

}


Transform2D::~Transform2D(void)
{
}

void Transform2D::Process()
{
	cv::Mat vector = cv::Mat(1, 3, CV_32FC1);
	inputs[0]->copyTo(vector(cv::Rect(0, 0, 2, 1)));
	vector.at<float>(0, 2) = 1.0f;

	outputs[0] = (transformationMatrix * vector.t());
	outputs[0] = (outputs[0].t())(cv::Range(0, 1), cv::Range(0, 2));

	//printMat(outputs[0]);
}